#include <iostream>
using namespace std;

void func(int*& rp)
{
	//p = 100;
	rp = new int(100);
}

int main(void)
{
	int *p = 0;
	func(p);

	cout << *p << endl;


/*
	int x = 100;
	int *p = &x;

	//rp就是指针的引用 rp == p
	int*& rp = p;

	(*rp)++;
	cout << "x: " << x << ", *p: " << *p << ", *rp: " << *rp << endl;
*/
	return 0;
}
